<?php
 error_reporting(E_ERROR);?>
<style>*{ font-size:12px; }h1{font-size:24px;}</style>
<h1>��Ѷ����֧�����в���</h1>
<form action="bank_callback_test.php" method="post">
���е�ַ��<input name="url" type="text" value="<?php
 echo(isset($_POST['url']) ? $_POST['url'] : "http://localhost/ekapay/callback/pay_bank_callback.php");?>" size="80"/>
<p><strong>����Э�����</strong><br>
</p>
<table border="1" cellspacing="0" cellpadding="0" width="552">
  <tr>
    <td width="144" valign="top">      �ֶ��� </td>
    <td width="408" valign="top"><p>˵��</p></td>
  </tr>
  <tr>
    <td width="144" valign="top"><p>orderid</p></td>
    <td width="408" valign="top"><p>
		<input type="text" name="orderid" value="<?php
 echo($_POST['orderid']);?>"/>
      ���й���д����orderid</p></td>
  </tr>
  <tr>
    <td width="144" valign="top"><p>opstate</p></td>
    <td width="408" valign="top"><p><input type="text" name="opstate"  value="<?php
 echo($_POST['opstate']);?>"/><br>�������״̬��<br>
      0 �����ɹ�ʹ��<br>
      -1 �����������<br>
      -2 ��ʵ����ֵ���ύʱ��ֵ������ʵ����ֵδʹ�á���ʵ����ֵ��ovalue��ʾ<br>
      -3 ��ʵ����ֵ���ύʱ��ֵ������ʵ����ֵ�ѱ�ʹ�á���ʵ����ֵ��ovalue��ʾ<br>
      -4 ���Ѿ�ʹ�ã������ύ����Ѷ��֮ǰ�Ѿ���ʹ�ã� <br>
      -5 ʧ��(����ԭ�򡢾���ԭ����ȷ��)</p></td>
  </tr>
  <tr>
    <td valign="top">ovalue</td>
    <td valign="top"><input type="text" name="ovalue"  value="<?php
 echo($_POST['ovalue']);?>"/>
      <br>
opstate=-2����-3ʱ��ʾ��ֵ����λԪ(ע����ֻ�ṩ��ȷ�Ŀ���ʵ����ֵ������ֵΪ0������Ч��Ϊ�˾�ȷ�ԣ���ֵ���ܴ���4λС��)</td>
  </tr>
  <tr>
    <td valign="top">ekaorderid</td>
    <td valign="top"><input type="text" name="ekaorderid"  value="<?php
 echo($_POST['ekaorderid']);?>"/>
      <br />
      �˴ο���Ĺ���м�Ѷϵͳ�Ķ���Id��Ϊ���ֺ���ǰ�汾���ݣ���ֵ�����뷵�ؽ��ǩ����֤��</td>
  </tr>
  <tr>
    <td valign="top">ekatime</td>
    <td valign="top"><input type="text" name="ekatime"  value="<?php
 echo($_POST['ekatime']);?>"/>
      <br />
      �˴ο���Ĺ���м�Ѷϵͳ�Ķ�������ʱ�䡣��ʽΪ<br />
        ��/��/�� ʱ���֣��룬��2014/08/25 21:50:58��<br />
      Ϊ���ֺ���ǰ�汾���ݣ���ֵ�����뷵�ؽ��ǩ����֤��</td>
  </tr>
  <tr>
    <td width="144" valign="top"><p>&nbsp;</p></td>
    <td width="408" valign="top"><p>
      <label>
      <input type="submit" name="Submit" value="ģ������">
      </label>
    </p></td>
  </tr>
</table>
<p><strong>����Э����� </strong></p>
<table border="1" cellspacing="0" cellpadding="0" width="552">
  <tr>
    <td width="144" valign="top"><p>�������</p></td>
    <td width="408" valign="top"><p>˵��</p></td>
  </tr>
  <tr>
    <td width="144" valign="top"><p>opstate</p></td>
    <td width="408" valign="top"><p>�������״̬��<br>
      0 �ɹ�<br>
      -1 ���������Ч<br>
      -2 ǩ�����</p></td>
  </tr>
</table>
</form>
<?php

require_once("../config/pay_config.php");
$callback_url	= $_POST['url'];

/*
$orderid
���й���д�����̻�orderid
*/
$orderid		= $_POST['orderid'];

/*
$opstate
�������״̬��
0 �����ɹ�ʹ��
-1 �����������
-2 ��ʵ����ֵ���ύʱ��ֵ������ʵ����ֵδʹ�á���ʵ����ֵ��ovalue��ʾ
-3 ��ʵ����ֵ���ύʱ��ֵ������ʵ����ֵ�ѱ�ʹ�á���ʵ����ֵ��ovalue��ʾ
-4 ���Ѿ�ʹ�ã������ύ����Ѷ��֮ǰ�Ѿ���ʹ�ã�
-5 ʧ��(����ԭ�򡢾���ԭ����ȷ��)

*/
$opstate		= $_POST['opstate'];

/*
opstate=-2����-3ʱ��ʾ��ֵ����λԪ(ע����ֻ�ṩ��ȷ�Ŀ���ʵ����ֵ������ֵΪ0������Ч��Ϊ�˾�ȷ�ԣ���ֵ���ܴ���4λС��)
*/
$ovalue			= $_POST['ovalue'];

/*
�˴ο���Ĺ���м�Ѷϵͳ�Ķ���Id
*/
$ekaorderid		= $_POST['ekaorderid'];

/*
�˴ο���Ĺ���м�Ѷϵͳ�Ķ�������ʱ��
*/
$ekatime		= $_POST['ekatime'];

$sign_text  = "orderid=" . $orderid . "&opstate=" . $opstate . "&ovalue=" . $ovalue;
$sign_md5 	= md5($sign_text .$eka_merchant_key);


$url = 	$callback_url . '?' . $sign_text . "&sign=" .$sign_md5;
$url .= "&ekaorderid=$ekaorderid&ekatime=$ekatime";

echo("�����ַ�� ". $url);

$result=file_get_contents($url);
echo("<br />������ ". $result);


?>